<?php

use Illuminate\Database\Seeder;

class TeacherSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $faker = \Faker\Factory::create('zh_CN');

        //通过for循环 填充想要大量的数据
        for($i=0;$i<60;$i++){

        // 通过DB门面调用table() 方法 向teacher表插入大量数据
        \DB::table('teacher')->insert([
            'teacher_name'=> $faker->name,
            'teacher_phone'=>$faker->phoneNumber,
            'teacher_city'=>$faker->city,
            'teacher_address'=>$faker->address,
            'teacher_company'=>$faker->company,
            'teacher_email'=>$faker->email,
            'teacher_pic'=>$faker->imageUrl(),
            'teacher_desc'=>$faker->catchphrase
        ]);

        }
    }
}
